<%@ include file="/WEB-INF/template/include.jsp"%>
<%@ include file="localHeader.jsp"%>
<openmrs:htmlInclude file="/scripts/calendar/calendar.js" />
<openmrs:htmlInclude file="/scripts/jquery/jquery-1.3.2.min.js" />
<openmrs:require privilege="View Orders" otherwise="/login.htm" redirect="/module/simplelabentry/resultEntry.htm" />
<script type="text/javascript" src="${pageContext.request.contextPath}/moduleResources/hospitalcore/scripts/jquery/jquery.search.js"></script>
<br/>

<script>
	function getMonth(month){
		if(month<10){
			month = "0" + month;
		}
		return month;		
	}
	
	function getDate(date){
		if(date<10){
			date = "0" + date;
		}
		return date;	
	}
	
	$(document).ready(function() {
		var date = new Date();
		var dateStr = getDate(date.getDate()) + "/" + getMonth(date.getMonth()+1) + "/" + date.getFullYear();
		$("#orderDate").val(dateStr);
	});
</script>


<b class="boxHeader">Step 1. See Patient List by choosing lab:</b>
<div class="box">
	<table>

		<tr>
			<td>
			   Order date:
			</td>
			<td>
				<input type="text" id="orderDate" name="orderDate" size="10" value="${param.orderDate}" onFocus="showCalendar(this)" />
			</td>
			<td>
				<div id="advSearch"></div>
			</td>
		</tr>
	</table>
</div>
<br/>
<div id="patientResult"></div>
<script>
	$("#advSearch").toggleSearchBox({
		view:'labentry_printPatientReport'
	});
</script>
<br/>

<c:if test="${!empty param.identifier || !empty param.orderDate}">
    <openmrs:portlet url="patientReport"
                     id="orderEntrySectionId"
                     moduleId="simplelabentry"
                     parameters="workList=false|confidentialTest=false|limit=closed|identifier=${param.identifier}|orderDate=${param.orderDate}" />
</c:if>
<%@ include file="/WEB-INF/template/footer.jsp"%>